
/**
 * 构建审核条件组
 * @param groupId
 * @param actRoutes
 */
function buildAuditRouteGroup(groupId, actRoutes) {
    if(CommUtil.isEmpty(actRoutes)){
        dialogTipError("渲染结论条件有误, 请联系管理员");
        return;
    }
    var str = new StringBuffer();
    for (var i = 0; i < actRoutes.length; i++) {
        var item = actRoutes[i];
        str.append('<label class="radio-inline">');
        str.append('<input type="radio" name="routeId" value="' + item.id + '" required/>');
        str.append('<span class="radio-label">'+item.condDesc+'</span>');
        str.append('</label>');
    }
    $("#"+groupId).html(str.toString());
}

/**
 * 公共 审核
 * @param url
 * @param success
 * @returns {boolean}
 */
function submitAuditForCommon(url, success) {
    var taskId = $("#taskId").val();
    if(CommUtil.isEmpty(taskId)){
        dialogTipError("task参数缺失, 请联系系统管理员");
        return false;
    }
    var routeId = $("input[name=routeId]:checked").val();
    if(CommUtil.isEmpty(routeId)){
        dialogTipError("请选择结论");
        return false;
    }
    var remarks = $("#remarks").val();
    if(CommUtil.isEmpty(remarks)){
        dialogTipError("请填写备注");
        return false;
    }
    //防止重复提交
    FormUtil.blockRepeatSubmit($('#auditForm'), 2000);
    //提交审核
    HttpUtil.ajaxAsyncJsonPost(url, {taskId: taskId, routeId: routeId, remarks:remarks}, function (message) {
        dialogTipSuccess(message);
        if(typeof success == 'function'){
            success(message);
        }
    });
    return true;
}